package dazuoye.抽象数据类型面向对象风格;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.util.ArrayList;
import java.util.List;

public class KeyWord {
    private String url;
    private List<String> data=new ArrayList<>();
    private List<String> result=new ArrayList<>();
    private int n;

    public List<String> getResult() {
        return result;
    }

    public void setResult(List<String> result) {
        this.result = result;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public List<String> getData() {
        return data;
    }

    public void setData(List<String> data) {
        this.data = data;
    }

    public int getN() {
        return n;
    }

    public void setN(int n) {
        this.n = n;
    }

    public void getKeyWord() throws Exception {
        File file= new File(url);
        BufferedReader input= new BufferedReader(new FileReader(file));
        String s;
        while((s=input.readLine())!=null)
        {
            data.add(s);
        }
    }
}
